﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OrganizeYourSearch    
{
    public class TabsManager
    {
        LinkedList<CloseableTabItem> tabItemList;
        LinkedListNode<CloseableTabItem> nodeInstance;

        public static TabsManager PagesTabManager=new TabsManager();
        public TabsManager()
        {
            tabItemList = new LinkedList<CloseableTabItem>();
            nodeInstance = new LinkedListNode<CloseableTabItem>(null);
        }
        public bool RegisterNewTabItem(CloseableTabItem newItem)
        {
            if (tabItemList.AddLast(newItem) != null)
            {
                return true;
            }
            else
                return false;
        }
        public bool UnregisterClosingTabItem(CloseableTabItem closingItem)
        {
            return (tabItemList.Remove(closingItem));
        }
  
    }
}
